<!--
 * @Description:
 * @version:
 * @Author: 尹鹏孝
 * @Date: 2023-03-03 11:52:00
 * @LastEditors: 尹鹏孝
 * @LastEditTime: 2023-03-06 08:51:21
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
                                    <!-- +---------------------+
                                    | |
                                    | @vue/compiler-sfc |
                                    | |
                                    +-----+--------+------+
                                    | |
                                    v v
                                    +---------------------+ +----------------------+
                                    | | | |
                                    +------------\>| @vue/compiler-dom +---\>| @vue/compiler-core |
                                    | | | | |
                                    +----+----+ +---------------------+ +----------------------+
                                    | |
                                    | vue |
                                    | |
                                    +----+----+ +---------------------+ +----------------------+ +-------------------+
                                    | | | | | | |
                                    +------------\>| @vue/runtime-dom +---\>| @vue/runtime-core +---\>| @vue/reactivity |
                                    | | | | | |
                                    +---------------------+ +----------------------+ +-------------------+ -->

                                        <div id="id" v-model="aa"></div>
                                    <script>

                                        // vue2双向数据绑定核心原理
                                            const MyVue={
                                               aa:null
                                            }
                                            MyVue.bb=22123;
                                            console.log(MyVue.aa)
                                            Object.defineProperty(MyVue,"aa",{
                                                writable:true,//可修改
                                                configurable:true,//可删除
                                                enumerable:true,//可枚举
                                                value:123,
                                                get function(){
                                                    return this.__aa__;
                                                },
                                                set function(m){
                                                  return 999;
                                                },
                                            })
                                            MyVue.aa=1222;
                                            console.log(MyVue.bb)
                                             console.log(MyVue.aa)

                                             let vm = new MyVue();

                                             let id = document.querySelector("#id");
                                             id.attributes("")
                                             id.addEventListener("input",vm,false)
                                    </script>
</body>
</html>